#include <iostream>
using namespace std;
int main()
{
	bool t[100][100] = {false};
	int n,x1,y1,x2,y2,num=0;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> x1 >> y1 >> x2 >> y2;
		for (int x = x1 - 1; x < x2; x++)
		{
			for (int y = y1 - 1; y < y2; y++)
			{
				if (!t[x][y])
				{
					t[x][y] = true;
					num++;
				}
			}
		}
	}
	cout << num;
	return 0;
}